<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/jquery.min.js" type="text/javascript"></script>
<!--    <script src="js/ruku/rukubanli.js" type="text/javascript"></script>-->
</head>
<body>
<form action="rkjsuan3.do" id="form002" onsubmit="return tijiaoform()">
    <table border="1" style="border: skyblue" width="1200px">

        <input type="hidden" id="rukudanhao001" name="rukudanhao">
        <tr>
            <td colspan="12" style="text-align: center"><font color="blue">待结算入库单</font></td>
        </tr>
        <tr></tr>
        <tr style="{background-color: aqua;text-align: center}">
            <td colspan="3" bgcolor="#87ceeb" style="text-align: center">货主</td><td colspan="3" bgcolor="#87ceeb" style="text-align: center">入库单号</td><td colspan="3" bgcolor="#87ceeb" style="text-align: center">重量（公斤）</td><td colspan="3" bgcolor="#87ceeb" style="text-align: center">托盘（个）</td>
        </tr>

        <tr th:each="eveBillsJieSuan:${wmsTBillsJieSuan}">
            <td colspan="3"><input type="radio" name="eveBillsJieSuanId" th:value="${eveBillsJieSuan.billId}" id="eveBillsJieSuanId" onclick="huoQuShuJu(this.value)"><span th:text="${eveBillsJieSuan.custName}"></span></td>
            <td colspan="3" th:text="${eveBillsJieSuan.billId}" name="build"></td>
            <td colspan="3" th:text="${eveBillsJieSuan.zhongLiang}"></td>
            <td colspan="3" th:text="${eveBillsJieSuan.tuoPanGeShu}"></td>
        </tr>
<!--        <tr>-->
<!--            <td colspan="3">张志军</td><td colspan="3">1605555555555</td><td colspan="3">10000.0</td><td colspan="3">1</td>-->
<!--        </tr>-->
<!--        <tr style="width: auto">-->
<!--            <td colspan="3">张小军</td><td colspan="3">160666666666</td><td colspan="3">4000000.0</td><td colspan="3">1</td>-->
<!--        </tr>-->

<tr style="border: 0"></tr>
        <tr>
            <td colspan="12" ><font color="blue">入库单详情</font></td>
        </tr>

<!--        <div th:if="${session.wmsTBill66!=null}">-->
        <table th:each="evegetWmsTBillDetails1:${session.wmsTBill66}" border="1" style="border: skyblue" width="1200px">
            <tr>
                <td colspan="4">货主</td><td colspan="4">入库单号</td><td colspan="4">业务时间</td>
            </tr>
            <tr>
                <td colspan="4" th:text="${evegetWmsTBillDetails1.getCustName()}"></td>
                <td colspan="4" th:text="${evegetWmsTBillDetails1.getBillId()}">
                <td colspan="4" th:text="${evegetWmsTBillDetails1.getBillDate()}"></td>
            </tr>
        </table>

        <table  border="1" style="border: skyblue" width="1200px" id="table001">

        </table>



            <table border="1" style="border: skyblue" width="1200px">
                <tr>
                    <td colspan="12"><font color="blue">费用结算</font></td>
                </tr>
            <tr>
                <td colspan="5">力资费用：<input type="text" id="lizifeiyong" name="lizifeiyong">元 &emsp;&emsp; </td>
                <td colspan="5">其他费用：<input type="text" id="qitafeiyong" name="qitafeiyong">元 &emsp; </td>
                <td colspan="2"><input type="hidden" ></td></td>
        </tr>
        <tr>
            <td colspan="5">合计应收：<input type="text" id="hejiyingshou" >元 &emsp;&emsp; </td>
            <td colspan="5">合计实收：<input type="text" id="hejishishou">元 &emsp; </td>
            <td colspan="2"><input type="submit" value="结算费用"></td>
        </tr>
            </table>

<!--        </div>-->
    </table>
</form>
</body>
<script type="text/javascript">
    function tijiaoform() {
        alert("结算成功！")
        return true;
    }

    function huoQuShuJu(billId) {
        $("#table001").html("");
                $.ajax({
                    type:"post",
                    url:"rkjsuan2.do?eveId66="+billId,
                    success:function (data) {
                        alert(billId)
                        $("#rukudanhao001").val(billId);
                        var list = data.wmsTBillDetails;

                        $("#lizifeiyong").val(data.billFeeTruckage);
                        $("#qitafeiyong").val(data.billFeeOther);
                        $("#hejiyingshou").val(data.billFeeTruckage+data.billFeeOther);
                        $("#hejishishou").val(data.billFeeTruckage+data.billFeeOther);
                        for (var i = 0; i <list.length ; i++) {
                            $("#table001").append("<tr>\n" +
                                "                <td colspan=\"2\">托盘编号:"+list[i].trayId+"</td>\n" +
                                "                <td colspan=\"2\">货物名称:"+list[i].detailsGoodsName+"</td>\n" +
                                "                <td colspan=\"2\">规格（公斤/件）:"+list[i].detailsGoodsSpec+"</td>\n" +
                                "                <td colspan=\"2\">件数:"+list[i].detailsGoodsNum+"</td>\n" +
                                "                <td colspan=\"2\">重量（公斤）:"+list[i].detailsGoodsSpec * list[i].detailsGoodsNum+"</td>\n" +
                                "                <td colspan=\"2\">检货员:"+list[i].detailsAffirmant+"</td>\n" +
                                "            </tr>\n" +
                                "            <tr>\n" +
                                "                <td colspan=\"12\">总件数："+list[i].detailsGoodsNum+"</td>\n" +
                                "            </tr>\n" +
                                "            <tr>\n" +
                                "                <td colspan=\"12\">备注：</td>\n" +
                                "            </tr>\n" +
                                "            <tr>\n" +
                                "                <td class=\"ta_01\" bgColor=\"#ffffff\" colspan=\"12\">\n" +
                                "                    <textarea name=\"pdesc\" rows=\"5\" cols=\"50\"></textarea>\n" +
                                "                </td>\n" +
                                "            </tr>")
                        }
                    }
                })

    }
</script>
</html>